home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / strategy / vga_card.000 / vga_cardgames-1.3.1.tar / vga_cardgames / solitaire.h < prev    next >
C/C++ Source or Header  |  1994-05-05  |  2KB  |  72 lines

  1. /*
  2.  * Solitaire game (name unknown)
  3.  *
  4.  * Copyright (C) Evan Harris, 1991, 1994
  5.  *
  6.  * Permission is granted to freely redistribute and modify this code,
  7.  * providing the author(s) get credit for having written it.
  8.  */
  9.  
  10. #include "common.h"
  11.  
  12.  
  13. #define POSN(col, row)        ((col) * 100 + (row))
  14. #define ROW(pos)        ((pos) % 100)
  15. #define COL(pos)        ((pos) / 100)
  16. #define NOPOSN            -1
  17.  
  18.  
  19. #define CARD(suit, type)    ((suit) * 13 + (type))
  20. #define NOCARD            255
  21. #define SUIT(card)        ((card) / 13)
  22. #define TYPE(card)        ((card) % 13)
  23. #define ISCARD(card)        ((card) >= 0 && (card) < 52)
  24.  
  25.  
  26. #define NUMCARDS        52
  27. #define COLUMNS            7
  28.  
  29.  
  30. #define SPADES            0
  31. #define CLUBS            1
  32. #define HEARTS            2
  33. #define DIAMONDS        3
  34.  
  35. #define ACE            0
  36. #define TWO            1
  37. #define THREE            2
  38. #define FOUR            3
  39. #define FIVE            4
  40. #define SIX            5
  41. #define SEVEN            6
  42. #define EIGHT            7
  43. #define NINE            8
  44. #define TEN            9
  45. #define JACK            10
  46. #define QUEEN            11
  47. #define KING            12
  48.  
  49.  
  50. extern unsigned char    column[COLUMNS];    /* First card of column */
  51. extern short        cards[NUMCARDS];    /* Positions of cards */
  52. extern unsigned char    next[NUMCARDS];        /* Card underneath */
  53. extern unsigned char    hidden[NUMCARDS];    /* Cards which are face down */
  54.  
  55.  
  56. void    main(int, char **);
  57. void    exit(int);
  58.  
  59. void    Abort(char *);
  60. void    InitDisplay(int, char **);
  61. void    DisplayColumn(short);
  62.  
  63. void    Deal(void);
  64.  
  65. short    GetCmd(void);
  66. short    FindDest(unsigned char);
  67. void    MakeMove(unsigned char, short);
  68.  
  69. void    AddUndo(unsigned char, unsigned char, short);
  70. void    Undo(void);
  71. void    UndoMove(unsigned char, short, unsigned char);
  72.